<template>
	<div class="product-list-main">
		<view class="product-list">
			
			<navigator class="product-block" :key="item.id" :url="'/pages/kind/detail/index?productId='+item.id" v-for="(item,index) in data">
				<image class="img" :src="item.pic" mode="scaleToFill"></image>
				<view class="text-area">
					<view class="gname">
						{{item.brandName}}
					</view>
					<view class="price-origin">
						<text class="price">¥{{item.price | money}}</text>
						<text class="origin">{{item.origin_city||'乐居'}}</text>
					</view>
				</view>
			</navigator>
			
		</view>
	</div>
</template>

<script>
	export default {
		props:{
			'data': {
				type: Array,
				default(){
					return []
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.product-list-main{
		.product-list {
			width: 100%;
			overflow: hidden;
			display: flex;
			align-items: center;
			justify-content: space-between;
			flex-wrap: wrap;
			// column-count:2;
			// column-gap:0;
			.product-block {
				float: left;
				width: 334rpx;
				margin: 20rpx auto;
				background-color: #fff;
				border-radius: 4px;
				// break-inside: unset;
				.img {
					width: 100%;
					height: 238rpx;
				}
		
				.text-area {
					padding: 36rpx;
					font-size: 26rpx;
		
					.gname {
						color: #3E3E3E;
						line-height: 38rpx;
						margin-top: 8rpx;
						font-weight: bold;
						text-overflow: ellipsis;
						overflow: hidden;
						white-space: nowrap;
					}
		
					.price-origin {
						display: flex;
						justify-content: space-between;
						align-items: center;
						margin-top: 20rpx;
		
						.origin {
							color: #3E3E3E;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
						}
					}
				}
		
			}
		}
	}
</style>
